#pragma once
#include <DirectXMath.h>

//
// Pre light pass constant buffers for rendering simple geometry information into the G-Buffer.
//

struct LightPrePassOnWindowSizeChange
{
	DirectX::XMFLOAT4X4 Projection;
};

struct LightPrePassPerFrame
{
	DirectX::XMFLOAT4X4 View;
};

struct LightPrePassPerMesh
{
	DirectX::XMFLOAT4X4 World;
	float SpecularPower;
};

//
// Light pass constant buffers describing the characteristics of the light(s) to be rendered.
//

struct LightPassOnWindowSizeChange
{
	DirectX::XMFLOAT4X4 TransformationMatrix;
};

struct LightPassLightParameters
{
	// x,y,z = R,G,B. w = (currently not implemented) power curve for light dimming over the range of the light. 1.0f will be a straight light fall-off so use that for now.
	DirectX::XMFLOAT4 LightColorAndFalloff;
};

struct LightPassViewParameters
{
	// Current world coordinates of the camera.
	DirectX::XMFLOAT4 ViewPosition;
};

struct LightPassPointLightDetails
{
	// x,y,z = x,y,z coordinates of the light's world position. w = The world unit effective range of the light (the light tapers off from its position until it reaches this distance).
	DirectX::XMFLOAT4 LightPositionAndRange;
};

struct LightPassSpotLightDetails
{
	// x,y,z = x,y,z coordinates of the light's world position. w = The world unit effective range of the light (the light tapers off from its position until it reaches this distance).
	DirectX::XMFLOAT4 LightPositionAndRange;
	// x,y,z = Direction of the light. w = The exponent that controls the spot light concentration.
	DirectX::XMFLOAT4 DirectionAndSpotExponent;
	// x - attenuation constant. y - attenuation linear. z - attenuation quadratic. w - unused.
	DirectX::XMFLOAT4 AttenuationConstants;
};

//
// Post light pass constant buffers containing the information necessary to combine the G-Buffer and the light buffer into the complete rendered scene. (Post processing can go after this).
//

struct LightFinalPassOnWindowSizeChange
{
	DirectX::XMFLOAT4X4 Projection;
};

struct LightFinalPassPerFrame
{
	DirectX::XMFLOAT4X4 View;
	DirectX::XMFLOAT4 AmbientColor;
};

struct LightFinalPassPerMesh
{
	DirectX::XMFLOAT4X4 World;
	// x,y,z = R,G,B color of the shininess of the light. w = unused.
	DirectX::XMFLOAT4 SpecularColor;
	// The final color of all pixels will be multiplied by this. { 1.0f, 1.0f, 1.0f, 1.0f } represents no tint.
	DirectX::XMFLOAT4 DiffuseTint;
	// Additive tint color.
	DirectX::XMFLOAT4 MeshColor;
	// x = 0.0f - 1.0f multiplier for the mesh color's influence. y = 0.0f - 1.0f multiplier for the diffuse texture's influence. z, w = unused.
	DirectX::XMFLOAT4 OverridePercentDiffusePercent;
};
